home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 3.1 KB | 138 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWFloWin.cpp
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifdef FW_PRECOMPILE_BY_LAYER
- #include "FWOS.hpp"
- #endif
-
- #ifdef FW_PRECOMPILE_BY_SUBSYSTEM
- #include "FWWindow.hpp"
- #endif
-
-
- #ifndef FWFLOWIN_H
- #include "FWFloWin.h"
- #endif
-
- #ifndef FWACQUIR_H
- #include "FWAcquir.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWEXCLIB_H
- #include "FWExcLib.h"
- #endif
-
- #ifndef FWRESACC_H
- #include "FWResAcc.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_ODWindow_xh
- #include <Window.xh>
- #endif
-
- #ifndef SOM_ODStorageUnit_xh
- #include <StorageU.xh>
- #endif
-
- #ifndef SOM_ODSession_xh
- #include <ODSessn.xh>
- #endif
-
- #ifndef SOM_ODInfo_xh
- #include <Info.xh>
- #endif
-
- #ifndef SOM_ODPart_xh
- #include <Part.xh>
- #endif
-
- //========================================================================================
- // Runtime Info
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwwindow
- #endif
-
-
- FW_DEFINE_CLASS_M1(FW_CFloatingWindow, FW_CWindow)
-
- //========================================================================================
- // CLASS FW_CFloatingWindow
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CFloatingWindow::FW_CFloatingWindow
- //----------------------------------------------------------------------------------------
-
- FW_CFloatingWindow::FW_CFloatingWindow(Environment* ev,
- ODPart* odPart,
- ODTypeToken presentation,
- const FW_CString& windowTitle,
- const FW_CPoint& interiorSize,
- const FW_CPoint& position,
- FW_Boolean hasCloseBox) :
- FW_CWindow(ev,
- odPart,
- NULL,
- FALSE,
- odPart->GetStorageUnit(ev)->GetSession(ev)->Tokenize(ev, kODViewAsFrame),
- presentation,
- windowTitle,
- interiorSize,
- position,
- FW_kFloatingWindow | (hasCloseBox ? FW_kHasCloseBox : 0)),
- fWasShown(FALSE)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CFloatingWindow::~FW_CFloatingWindow
- //----------------------------------------------------------------------------------------
-
- FW_CFloatingWindow::~FW_CFloatingWindow()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CFloatingWindow::HideShowOnActivate
- //----------------------------------------------------------------------------------------
-
- void FW_CFloatingWindow::HideShowOnActivate(Environment* ev, FW_Boolean state)
- {
- if (GetID(ev) == kODNULLID)
- return;
-
- FW_CAcquiredODWindow aqODWindow = AcquireODWindow(ev);
- if (state)
- {
- if (fWasShown)
- aqODWindow->Show(ev);
- fWasShown = FALSE;
- aqODWindow->Update(ev);
- }
- else
- {
- if (IsShown(ev))
- {
- aqODWindow->Hide(ev);
- fWasShown = TRUE;
- }
- }
- }
-
-